﻿<div class="modal-form">
    @using (Html.BeginForm("Login", "Account", new RouteValueDictionary { { "ReturnUrl", Request.Url.OriginalString } }, FormMethod.Post, new Dictionary<string, object> { { "data-bind", "validationOptions: { insertMessages: false }, css:{ error : lVM.isError} " }, { "id", "login-form" } }))
    {
        @Html.AntiForgeryToken()
        <input class="input" id="UserName" name="UserName" type="text" value="" placeholder="логин" data-bind="value: lVM.Login, event: { focus: lVM.StartEdit }" />
        <input class="input" id="Password" name="Password" type="password" placeholder="пароль" data-bind="value: lVM.Password, event: { focus: lVM.StartEdit }" />
        <div class="status">
            <div class="checkbox">
                <i class="icon icon-checkbox"></i>запомнить меня
                                        <input type="checkbox">
            </div>
            <div class="submit button" >войти</div>
            <div class="error">
                <i class="icon icon-error"></i><span data-bind="text: lVM.errorMessage"></span>
                <span data-bind="validationMessage: lVM.Login"></span>
                <span data-bind="validationMessage: lVM.Password"></span>
            </div>
        </div>
    }
    @using (Html.BeginForm("ExternalLogin", "Account", new { ReturnUrl = Request.Url.OriginalString }, FormMethod.Post, new { @class = "social", id = "socialLogin" }))
    {
        @Html.AntiForgeryToken()
        <input id="provider" type="hidden" name="provider" value="" />
        <div class="social-text">Так же вы можете войти используя следующие сайты:</div>
        <ul class="social-icons">
            <!--<li><a href="#" onclick="var prov = 'vkontakte'; socialLogin();"><i class="icon icon-vk"></i></a></li>-->
            <!--<li><a href="#" onclick="socialLogin('facebook')"><i class="icon icon-fb"></i></a></li>
            <li><a href="#" onclick="socialLogin('twitter')"><i class="icon icon-tw"></i></a></li>-->
            <li><a href="#" onclick="socialLogin('google')"><i class="icon icon-g"></i></a></li>
        </ul>
        <script type="text/javascript">
            function socialLogin(provider) {
                document.getElementById('provider').value = provider;
                document.getElementById('socialLogin').submit()
            }
        </script>
    }
</div>
